// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const env = "fz-xiaochengxu-3ggm49cn525bedba";
const db = cloud.database({
    env
});

// 云函数入口函数
exports.main = async (event, context) => {
    const _ = db.command;
    db.collection('subscription').where({
        encounterId : _.eq(event.encounterId),
        userId:_.neq(event.userId)
    })
    .update({
        data: {
            isNew: _.set(event.isNew)
        }
    });
}